<?php

/**
 * TarifArticle form base class.
 *
 * @method TarifArticle getObject() Returns the current form's model object
 *
 * @package    SdCommerce
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseTarifArticleForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_article'          => new sfWidgetFormInputHidden(),
      'id_tarif'            => new sfWidgetFormInputHidden(),
      'id_unite_logistique' => new sfWidgetFormInputHidden(),
      'montant_t_t_c'       => new sfWidgetFormInputText(),
      'montant_h_t'         => new sfWidgetFormInputText(),
      'created_at'          => new sfWidgetFormDateTime(),
      'updated_at'          => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id_article'          => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id_article')), 'empty_value' => $this->getObject()->get('id_article'), 'required' => false)),
      'id_tarif'            => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id_tarif')), 'empty_value' => $this->getObject()->get('id_tarif'), 'required' => false)),
      'id_unite_logistique' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id_unite_logistique')), 'empty_value' => $this->getObject()->get('id_unite_logistique'), 'required' => false)),
      'montant_t_t_c'       => new sfValidatorNumber(),
      'montant_h_t'         => new sfValidatorNumber(),
      'created_at'          => new sfValidatorDateTime(),
      'updated_at'          => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('tarif_article[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'TarifArticle';
  }

}
